/**
 * Author@ Cheng Feitian
 * Date: 2020-3-21
 * Description: 引用的注意事项
 */

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;
const int maxn = 1024;

int main() {

    int a = 10;
    //1.引用必须初始化
    //int &b; //error 必须初始化
    int &b = a;
    
    //2.引用在初始化后，不可以发生改变
    int c = 20;

    b = c;  //复制操作，而不是更改引用
    cout << "a = " << a << endl;
    cout << "b = " << b << endl;
    cout << "c = " << c << endl;
    return 0;
}
